<div class="bjui-pageContent">
    <table id="flow-list" class="table table-bordered" data-toggle="datagrid" data-options="{
        height: '100%',
        dataUrl: '/admin/administration/workflow/flow-list',
        paging: {showPagenum:10, selectPageSize:'20,50,100', pageCurrent:1, pageSize:20},
        fullGrid: true,
        linenumberAll: true,
        showToolbar: true,
        toolbarCustom: toolbar,
        filterThead:false,
        fieldSortable:false,
        columnMenu:false
    }">
        <thead>
        <tr>
            <th data-options="{name:'name',align:'center',width:70}">名称</th>
            <th data-options="{name:'description',align:'center',width:70}">描述</th>
            <th data-options="{name:'display',align:'center',width:70, items:[{1:'是'},{0:'否'}]}">显示</th>
            <th data-options="{align:'center',render:operationColumn}">操作</th>
        </tr>
        </thead>
    </table>
</div>
<script>
    function toolbar() {
        var html = '<button type="button" class="btn btn-blue"  data-toggle="dialog" data-options="{id:\'flow-add\', url:\'/admin/administration/workflow/flow-add\', title:\'流程添加\', width:900, height:400, mask:true}"><i class="fa fa-plus"></i> 添加</button>';
        return html;
    }

    function operationColumn(value, data) {
        var html = '<button type="button" class="btn btn-blue" data-toggle="dialog" data-options="{id:\'flow-edit\', url:\'admin/administration/workflow/flow-edit\', fresh:true, title:\'流程编辑\', data:{flow_id:' + data.id + '}, mask:true}">编辑</button>';
        html += '<button type="button" class="btn btn-blue" data-toggle="navtab" data-options="{id:\'flow-config\', url:\'admin/administration/workflow/flow-config\', fresh:true, title:\'流程配置\', data:{flow_config_id:' + data.id + '}}">配置</button>';
        return html;
    }
</script>